﻿@if (Model.MainState == EditState.Preview)
{
    <CnGalWebSite.Shared.MasaComponent.Shared.Editors.Buttons.RevokeButton Url="@("/peripheries/EditMain/" + Model.Id)" ExamineType="Operation.EditPeripheryMain" OnClickRevoke="OnRevoke"/>
}

<CnGalWebSite.Components.Containers.MasaTitleContainer Title="基础信息" Icon="@IconType.Infor.ToIconString()" Class="mb-4">
    <div class=" basic-info-group-card">

        <div>
           <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="IconType.Tag"/>@Model.Type.GetDisplayName()
        </div>
        @if (string.IsNullOrWhiteSpace(Model.Category) == false)
        {
            <div>
                <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="IconType.Category" />@Model.Category
            </div>
        }
        @if (string.IsNullOrWhiteSpace(Model.Size) == false)
        {
            <div>
                <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="IconType.Size" />尺寸：@Model.Size
            </div>
        }
        @if (string.IsNullOrWhiteSpace(Model.Brand) == false)
        {
            <div>
                <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="IconType.Brand" />品牌：@Model.Brand
            </div>
        }
        @if (string.IsNullOrWhiteSpace(Model.Author) == false)
        {
            <div>
                <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="IconType.User" />作者：@Model.Author
            </div>
        }
        @if (string.IsNullOrWhiteSpace(Model.Material) == false)
        {
            <div>
                <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="IconType.Material" />材质：@Model.Material
            </div>
        }
        @if (string.IsNullOrWhiteSpace(Model.IndividualParts) == false)
        {
            <div>
                <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="IconType.Count" />单独部件数量：@Model.IndividualParts
            </div>
        }
        @if (string.IsNullOrWhiteSpace(Model.Price) == false)
        {
            <div>
                <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="IconType.Price" />价格：@Model.Price
            </div>
        }
        @if (Model.IsReprint)
        {
            <div>
                <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="IconType.Update" />已再版
            </div>
        }
        else
        {
            <div>
                <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="IconType.Takedown" />未再版
    </div>

        }

        @if (Model.IsAvailableItem)
        {
            <div>
                <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="IconType.Ornament" />装饰品
            </div>

        }

        @if (Model.Type == PeripheryType.SetorAlbumEtc)
        {
            @if (Model.PageCount != 0)
            {
                <div>
                    <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="IconType.Count" />页数：@Model.PageCount
                </div>
            }
        }
        @if (Model.Type == PeripheryType.Ost)
        {
            @if (Model.SongCount != 0)
            {
                <div>
                    <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="IconType.Count" />歌曲数：@Model.SongCount
                </div>
            }
        }
        @if (string.IsNullOrWhiteSpace(Model.SaleLink) == false)
        {
            <div>
                <CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaIcon Type="IconType.Link" />
                <span>
                    贩售链接：<a href="@Model.SaleLink" style="word-break: break-all;" target="_blank">@Model.SaleLink</a>
                </span>

            </div>
        }
    </div>

</CnGalWebSite.Components.Containers.MasaTitleContainer>

@code {

    [Parameter]
    public EventCallback<Operation> OnRevoke { get; set; }
    [Parameter]
    public PeripheryViewModel Model { get; set; }

}
